<?php 
include_once('connection/connection.php');
include('config.php');
//session_start();
//ob_start();
include('header.php');
include('menu.php');
?>
<?php
$sc=$_REQUEST['sch'];

if($sc=="P")
{
 $sc="P&T";
}else{
$sc=$sc;
}
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<link href="css/style_question.css" type="text/css" rel="stylesheet" />
<script language="javascript" src="js/ajaxFunction1_q1.js"></script>
<script language="javascript" type="text/javascript" src="js/validate1.js"></script>
<script language=javascript>
function formshow_glr(val,i)
{ 
		if(val == "YES" )
		{
			document.getElementById('glr'+i).style.display = "block";	
		}
		else
		{
			document.getElementById('glr'+i).style.display = "none";
		} 
}
function formshow_cwt(val,i)
{
		if(val == "YES")
		{	
			document.getElementById('cwt'+i).style.display = "block";
		}
		else
		{
			document.getElementById('cwt'+i).style.display = "none";
		}
}
function mult()
{
	var value1=document.getElementById('population').value;
	var value2=(value1 * 0.04);
	//var value2=Math.round(value1 * 1.4);
	document.getElementById('water_demand').value=value2;	
}
</script>
<title><?php echo $scheme;?>&nbsp;Schemes</title>
</head>
<body>
<?php
if(isset($_POST['submit']))
{
		$fclick = true;
		$loc_id = $_SESSION['loc_id'];
		$population=$_POST['population'];
		$service_level=$_POST['service_level'];
		$water_demand=$population * $service_level; 
		$sub_total=$_POST['sub_total'];
		$mono_total=$_POST['mono_total'];
		$centi_total=$_POST['centi_total'];
		$sp_total=$_POST['sp_total'];
		$cwr_total=$_POST['cwr_total'];
		//$cwr_sc_st=$_POST['cwr_sc_st'];
		$glsr_total=$_POST['glsr_total'];
		//$glsr_sc_st=$_POST['glsr_sc_st'];
		$glr_total=$_POST['glr_total'];
		//$glr_sc_st=$_POST['glr_sc_st'];
		$ohsr_total=$_POST['ohsr_total'];
		//$ohsr_sc_st=$_POST['ohsr_sc_st'];
		$psp_total=$_POST['psp_total'];
		//$psp_sc_st=$_POST['psp_sc_st'];
		
/* ===================================================Q1 main table updation remaining fields============================================= */
		
		$qr1="UPDATE tbl_dtls_q1_main SET population='$population', water_demand='$water_demand', sub_total='$sub_total',  mono_total='$mono_total', centi_total='$centi_total', sp_total='$sp_total', cwr_total='$cwr_total', glsr_total='$glsr_total', glr_total='$glr_total', ohsr_total='$ohsr_total',  psp_total='$psp_total' WHERE id='$loc_id'";	
		//echo $qr1;
			$result1=mysql_query($qr1);
			if($result1)
			if($errorIns==0) 
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting main table <br>";
			}
			
/* ===================================================END Q1 main table updation remaining fields============================================= */
			
		for($i=1; $i<=$sub_total; $i++)
		{	
		$sub_id='sub_id'.$i;
		$sub_location='sub_location'.$i;
		$sub_latitude='sub_latitude'.$i;
		$sub_longitude='sub_longitude'.$i;
		$sub_status='sub_status'.$i;
		$sub_discharge='sub_discharge'.$i;
		$sub_head='sub_head'.$i;
		$sub_power='sub_power'.$i;
		$sub_id=$_POST[$sub_id];
		$sub_location=$_POST[$sub_location];
		$sub_latitude=$_POST[$sub_latitude];
		$sub_longitude=$_POST[$sub_longitude];
		$sub_status=$_POST[$sub_status];
		$sub_discharge=$_POST[$sub_discharge];
		$sub_head=$_POST[$sub_head];
		$sub_power=$_POST[$sub_power];
		$qr="INSERT INTO tbl_dtls_q1_asset(loc_id, asset_id,asset_location,asset_latitude,asset_longitude,asset_status, asset_discharge, asset_head, asset_power) VALUES ('$loc_id', '$sub_id', '$sub_location','$sub_latitude','$sub_longitude', '$sub_status', '$sub_discharge', '$sub_head', '$sub_power')";
			echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting asset table <br>";
			}
			
		for($i=1; $i<=$mono_total; $i++)
		{
		$mono_id='mono_id'.$i;
		$mono_status='mono_status'.$i;
		$mono_location='mono_location'.$i;
		$mono_latitude='mono_latitude'.$i;
		$mono_longitude='mono_longitude'.$i;
		$mono_discharge='mono_discharge'.$i;
		$mono_head='mono_head'.$i;
		$mono_power='mono_power'.$i;
		$mono_id=$_POST[$mono_id];
		$mono_location=$_POST[$mono_location];
		$mono_latitude=$_POST[$mono_latitude];
		$mono_longitude=$_POST[$mono_longitude];
		$mono_status=$_POST[$mono_status];
		$mono_discharge=$_POST[$mono_discharge];
		$mono_head=$_POST[$mono_head];
		$mono_power=$_POST[$mono_power];
		$qr="INSERT INTO tbl_dtls_q1_asset(loc_id, asset_id,asset_location,asset_latitude,asset_longitude,asset_status, asset_discharge, asset_head, asset_power) VALUES ('$loc_id', '$mono_id','$mono_location','$mono_latitude','$mono_longitude','$mono_status', '$mono_discharge', '$mono_head', '$mono_power')";
			echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting asset table <br>";
			}
			
		for($i=1; $i<=$centi_total; $i++)
		{
		$centi_id='centi_id'.$i;
		$centi_location='centi_location'.$i;
		$centi_latitude='centi_latitude'.$i;
		$centi_longitude='centi_longitude'.$i;
		$centi_status='centi_status'.$i;
		$centi_discharge='centi_discharge'.$i;
		$centi_head='centi_head'.$i;
		$centi_power='centi_power'.$i;
		$centi_id=$_POST[$centi_id];
		$centi_location=$_POST[$centi_location];
		$centi_latitude=$_POST[$centi_latitude];
		$centi_longitude=$_POST[$centi_longitude];
		$centi_status=$_POST[$centi_status];
		$centi_discharge=$_POST[$centi_discharge];
		$centi_head=$_POST[$centi_head];
		$centi_power=$_POST[$centi_power];	
		$qr="INSERT INTO tbl_dtls_q1_asset(loc_id, asset_id,asset_location,asset_latitude,asset_longitude, asset_status, asset_discharge, asset_head, asset_power) VALUES ('$loc_id', '$centi_id','$centi_location','$centi_latitude','$centi_longitude','$centi_status','$centi_discharge','$centi_head', '$centi_power')";
			echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting asset table <br>";
			}
			
		for($i=1; $i<=$sp_total; $i++)
		{
		$sp_id='sp_id'.$i;
		$sp_location='sp_location'.$i;
		$sp_latitude='sp_latitude'.$i;
		$sp_longitude='sp_longitude'.$i;
		$sp_status='sp_status'.$i;
		$sp_discharge='sp_discharge'.$i;
		$sp_head='sp_head'.$i;
		$sp_power='sp_power'.$i;
		$sp_id=$_POST[$sp_id];
		$sp_location=$_POST[$sp_location];
		$sp_latitude=$_POST[$sp_latitude];
		$sp_longitude=$_POST[$sp_longitude];
		$sp_status=$_POST[$sp_status];
		$sp_discharge=$_POST[$sp_discharge];
		$sp_head=$_POST[$sp_head];
		$sp_power=$_POST[$sp_power];
		$qr="INSERT INTO tbl_dtls_q1_asset(loc_id, asset_id,asset_location,asset_latitude,asset_longitude, asset_status, asset_discharge, asset_head, asset_power) VALUES ('$loc_id','$sp_id','$sp_location','$sp_latitude','$sp_longitude','$sp_status','$sp_discharge','$sp_head','$sp_power')";
			echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting asset table <br>";
			}
			
		for($i=1; $i<=$cwr_total; $i++)
		{
			$cwr_id='cwr_id'.$i;
			$cwr_capacity='cwr_capacity'.$i;
			$cwr_location='cwr_location'.$i;
			$cwr_latitude='cwr_latitude'.$i;
			$cwr_longitude='cwr_longitude'.$i;
			$cwr_sc_st='cwr_sc_st'.$i;
			$cwr_location=$_POST[$cwr_location];
			$cwr_latitude=$_POST[$cwr_latitude];
			$cwr_longitude=$_POST[$cwr_longitude];
			$cwr_id=$_POST[$cwr_id];
			$cwr_capacity=$_POST[$cwr_capacity];
			$cwr_sc_st=$_POST[$cwr_sc_st];
			$qr="INSERT INTO tbl_dtls_q1_reserv(loc_id, reserv_id,reserv_location,reserv_latitude,reserv_longitude, reserv_cap,reserv_scst) VALUES ('$loc_id', '$cwr_id','$cwr_location','$cwr_latitude','$cwr_longitude', '$cwr_capacity','$cwr_sc_st')";
			//echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting reserv table <br>";
			}

		
		for($i=1; $i<=$glsr_total; $i++)
		{
			$glsr_id='glsr_id'.$i;
			$glsr_capacity='glsr_capacity'.$i;
			$glsr_location='glsr_location'.$i;
			$glsr_latitude='glsr_latitude'.$i;
			$glsr_longitude='glsr_longitude'.$i;
			$glsr_capacity='glsr_capacity'.$i;
			$glsr_sc_st='glsr_sc_st'.$i;
			$glsr_id=$_POST[$glsr_id];
			$glsr_location=$_POST[$glsr_location];
			$glsr_latitude=$_POST[$glsr_latitude];
			$glsr_longitude=$_POST[$glsr_longitude];
			$glsr_capacity=$_POST[$glsr_capacity];
			$glsr_sc_st=$_POST[$glsr_sc_st];
			$qr="INSERT INTO tbl_dtls_q1_reserv(loc_id, reserv_id,reserv_location,reserv_latitude,reserv_longitude, reserv_cap,reserv_scst) VALUES ('$loc_id', '$glsr_id','$glsr_location','$glsr_latitude','$glsr_longitude', '$glsr_capacity','$glsr_sc_st')";
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting reserv table <br>";
			}
		
		for($i=1; $i<=$glr_total; $i++)
		{
			$glr_id='glr_id'.$i;
			$glr_capacity='glr_capacity'.$i;
			$glr_location='glr_location'.$i;
			$glr_latitude='glr_latitude'.$i;
			$glr_longitude='glr_longitude'.$i;
			$glr_capacity='glr_capacity'.$i;
			$glr_sc_st='glr_sc_st'.$i;
			$glr_id=$_POST[$glr_id];
			$glr_location=$_POST[$glr_location];
			$glr_latitude=$_POST[$glr_latitude];
			$glr_longitude=$_POST[$glr_longitude];
			$glr_capacity=$_POST[$glr_capacity];
			$grl_sc_st=$_POST[$glr_sc_st];
			$qr="INSERT INTO tbl_dtls_q1_reserv(loc_id, reserv_id,reserv_location,reserv_latitude,reserv_longitude, reserv_cap,reserv_scst) VALUES ('$loc_id', '$glr_id','$glr_location','$glr_latitude','$glr_longitude', '$glr_capacity','$grl_sc_st')";
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting reserv table <br>";
			}
		
		for($i=1; $i<=$ohsr_total; $i++)
		{
			$ohsr_id='ohsr_id'.$i;
			$ohsr_capacity='ohsr_capacity'.$i;
			$ohsr_location='ohsr_location'.$i;
			$ohsr_latitude='ohsr_latitude'.$i;
			$ohsr_longitude='ohsr_longitude'.$i;
			$ohsr_capacity='ohsr_capacity'.$i;
			$ohsr_sc_st='ohsr_sc_st'.$i;
			$ohsr_id=$_POST[$ohsr_id];
			$ohsr_location=$_POST[$ohsr_location];
			$ohsr_latitude=$_POST[$ohsr_latitude];
			$ohsr_longitude=$_POST[$ohsr_longitude];
			$ohsr_capacity=$_POST[$ohsr_capacity];
			$ohsr_sc_st=$_POST[$ohsr_sc_st];
			$qr="INSERT INTO tbl_dtls_q1_reserv(loc_id, reserv_id,reserv_location,reserv_latitude,reserv_longitude, reserv_cap,reserv_scst) VALUES ('$loc_id', '$ohsr_id', '$ohsr_location','$ohsr_latitude','$ohsr_longitude','$ohsr_capacity','$ohsr_sc_st')";
			//echo $qr;
			$res=mysql_query($qr);
		}
		if($res)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting reserv table <br>";
			}
					     	
		for($i=1; $i<=12; $i++)
		{
			$ris_material='ris_material'.$i;
			$ris_size='ris_size'.$i;
			$ris_length='ris_length'.$i;
			$dis_material='dis_material'.$i;
			$dis_size='dis_size'.$i;
			$dis_length='dis_length'.$i;
			$ris_material=$_POST[$ris_material];
			$ris_size=$_POST[$ris_size];
			$ris_length=$_POST[$ris_length];
			$dis_material=$_POST[$dis_material];
		    $dis_size=$_POST[$dis_size];
			$dis_length=$_POST[$dis_length];
			if($ris_material!="0" || $dis_material!="0"){
			$qr3="INSERT INTO tbl_dtls_q1_pipeline_ris_dis(loc_id, rising_material, rising_size, rising_length, distri_material, distri_size, distri_length) VALUES ('$loc_id', '$ris_material', '$ris_size', '$ris_length', '$dis_material', '$dis_size', '$dis_length')";
			echo $qr3;
			$result3=mysql_query($qr3);
		}	
			}
			if($result3)
			{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			}
			else 
			{
				$errorIns.="Error inserting pipeline table <br>";
			}
			for($i=1; $i<=$psp_total; $i++)
			{
				$psp_taps='psp_taps'.$i;
				$psp_loc='psp_loc'.$i;
				$psp_latitude='psp_latitude'.$i;
				$psp_longitude='psp_longitude'.$i;
				$psp_glr='psp_glr'.$i;
				$psp_cwt='psp_cwt'.$i;
				$sc_st='sc_st'.$i;
				$psp_taps=$_POST[$psp_taps];
				$psp_loc=$_POST[$psp_loc];
				$psp_latitude=$_POST[$psp_latitude];
				$psp_longitude=$_POST[$psp_longitude];
				$psp_glr=$_POST[$psp_glr];
				$psp_cwt=$_POST[$psp_cwt];
				$sc_st=$_POST[$sc_st];
				
				$qr4="INSERT INTO tbl_dtls_q1_psp(loc_id, psp_taps, psp_loc,psp_lat,psp_long, attached_glr, attached_cwt, sc_st) VALUES ('$loc_id', '$psp_taps', '$psp_loc', '$psp_latitude','$psp_longitude','$psp_glr', '$psp_cwt', '$sc_st')"; 
				//echo $qr4;
				$result4=mysql_query($qr4);
			}	
				if($result4)
				{
				$relocatePage=true;
				//header('Location: critical_form2.php');
				//echo "success 2";
			    }
			     else 
			      {
				$errorIns.="Error inserting psp table <br>";
			       }
			
			if($errorIns==0) 
			{
				header('Location: questionnaire1_3.php?sch='.$sc);
			}
			else 
			{
				echo $errorIns;exit;
			}						
}
else
{
	$fclick = false;
	$flag=0;
}
?>
<div align="center" style="padding-top:10px">
<form action="" method="post" enctype="multipart/form-data" name="questionnaire1_2" id="questionnaire1_2" onSubmit="return validate2()">
	<table border="0" width="794" id="table1" cellspacing="0" cellpadding="0" style="padding-left:5px;">
		<tr>
			<td height="30" align="center" bgcolor="#EEEEEE">
				<font face="Verdana" style="font-size: 10pt; font-weight: 700" color="#000000">
				<?php echo $sc;?>&nbsp;Schemes</font></td>
		</tr>
		
		<tr>
			<td align="center" bgcolor="#EEEEEE"><font face="Arial" style="font-size: 8.5pt" color="#000000">Page 2</font></td>
		</tr>
		<tr>
			<td bgcolor="#EEEEEE">&nbsp;</td>
		</tr>
		<tr>
			<td bgcolor="#C5D8EB" height="30"><font color="#006699">&nbsp;
				<span style="font-weight: 700">
				<font face="Arial" style="font-size: 8.5pt">Engineering Aspects</font></span></font></td>
		</tr>
		<tr>
		  <td><table border="0" width="793" id="table9" bgcolor="#EEEEEE" cellspacing="1" cellpadding="0">
            <tr>
              <td colspan="2"><span style="font-size: 4pt">&nbsp;</span> </td>
            </tr>
            <tr>
              <td colspan="2"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; <b>Design Parameters</b></font></td>
            </tr>
            <tr>
              <td width="399"><font face="Verdana" style="font-size: 8.5pt" color="#000000">&nbsp; 
                Population ( As per Design )</font></td>
              <td width="391"><input type="text" name="population" id="population" class="txt"></td>
            </tr>
            <tr>
             <td>&nbsp; <font style="font-size: 8.5pt" face="Verdana" color="#000000"> Service Level</font></td>
            <td width="391">
              <select name="service_level" id="service_level">
			  <option value="0.04">40</option>
			  <option value="0.07">70</option>
              </select>
           
              &nbsp;
			<!--<font style="font-size: 8.5pt" face="Verdana" color="#000000">0.04 times of population</font>-->			</td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td height="29" colspan="2" bgcolor="#C5D8EB">&nbsp;<font face="Verdana" color="#ffffff"><b><font style="font-size: 8.5pt">  </font></b></font><font style="font-size: 8.5pt"><b> <font face="Verdana" color="#006699">Assets (As in records) index 
                map for regional scheme to be provided in whatever form is 
                available </font></b></font></td>
            </tr>
            <tr>
              <td colspan="2">&nbsp; <font face="Verdana" color="#000000"><b> <font style="font-size: 8.5pt">Pumping Machinery </font></b> </font></td>
            </tr>
            <tr>
              <td colspan="3"><table border="0" width="791" cellspacing="0">
                  <tr>
                    <td align="center" height="28" bgcolor="#CCCCCC" width="27%"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Type</font></td>
                    <td align="center" height="28" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Total Nos.</font></td>
                  <tr align="center">
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
                  <tr align="center">
                    <td width="27%"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Submersible</font></td>
                    <td width="73%"><input type="text" name="sub_total" id="sub_total" size="18" class="txt5" onBlur="show_subm();numeric(this)"></td>
                  </tr>
				  <tr>
					<td colspan="2"><div id="subm"></div></td>
                  </tr>
                  <tr align="center">
                    <td width="27%"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Mono - Block</font></td>
                    <td width="73%"><input type="text" name="mono_total" id="mono_total" size="18" class="txt5" onBlur="show_mono();numeric(this)"></td>                    
                  </tr>
				  <tr>
					<td colspan="2"><div id="mono"></div></td>
                  </tr>
                  <tr align="center">
                    <td width="27%"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Centrifugal</font></td>
                    <td width="73%"><input type="text" name="centi_total" id="centi_total" size="18" class="txt5" onBlur="show_centi();numeric(this)"></td>
                  </tr>
				  <tr>
					<td colspan="2"><div id="centi"></div></td>
                  </tr>
                  <tr align="center">
                    <td width="27%"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Single Phase</font></td>
                    <td width="73%"><input type="text" name="sp_total" id="sp_total" size="18" class="txt5" onBlur="show_sp();numeric(this)"></td>
                  </tr>
				  <tr>
					<td colspan="2"><div id="sp"></div></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="2">&nbsp;</td>
            </tr>
            <tr>
              <td height="28" colspan="2" bgcolor="#C5D8EB">&nbsp; <font face="Verdana" color="#ffffff"><b> <font style="font-size: 8.5pt"></font></b></font><font style="font-size: 8.5pt"><b><font face="Verdana" color="#006699">Reservoirs</font></b></font></td>
            </tr>
            <tr>
              <td colspan="3"><table border="0" width="792" cellspacing="0" cellpadding="0">
                <tr>
                  <td width="280" align="center" height="31" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Type</font></td>
                  <td width="512" height="31" align="center" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Total Nos.</font></td>
                  </tr>
                <tr>
                  <td height="24">&nbsp;</td>
                  <td align="center">&nbsp;</td>
                </tr>
                <tr>
                  <td width="280" height="24" style="padding-left:10px"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Clear Water Reservoir (CWR) - Underground </font> </td>
                  <td align="center"><input type="text" name="cwr_total" id="cwr_total" size="18" class="txt5" onBlur="show_cwr_cap();numeric(this)"></td>
                  </tr>
					<tr>
					<td colspan="2"><div id="cwr_cap"></div></td>
                  </tr>	
                <tr>
                  <td width="280" height="28" style="padding-left:10px"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Ground Level Service Reservoir (GLSR)</font></td>
                  <td align="center"><input type="text" name="glsr_total" id="glsr_total" size="18" class="txt5" onBlur="show_glsr_cap();numeric(this)"></td>
                  </tr>
				<tr>
					<td colspan="2"><div id="glsr_cap"></div></td>
                  </tr>
                <tr>
                  <td width="280" height="30" style="padding-left:10px"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Ground Level Reservoir (GLR)</font></td>
                  <td align="center"><input type="text" name="glr_total" id="glr_total" size="18" class="txt5" onBlur="show_glr_cap();numeric(this)"></td>
                  </tr>
				<tr>
					<td colspan="2"><div id="glr_cap"></div></td>
                  </tr>
                <tr>
                  <td width="280" height="24" style="padding-left:10px"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Over Head Service Reservoir (OHSR)</font></td>
                  <td align="center"><input type="text" name="ohsr_total" id="ohsr_total" size="18" class="txt5" onBlur="show_ohsr_cap();numeric(this)"></td>
                  </tr>
				<tr>
					<td colspan="2"><div id="ohsr_cap"></div></td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
              <td height="29" colspan="3" bgcolor="#C5D8EB">&nbsp; <b> <font style="font-size: 8.5pt" face="Verdana" color="#006699"> Pipelines (Rising Main)</font></b></td>
            </tr>
            <tr>
              <td colspan="3"><table border="0" width="790" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="center" width="216" height="34" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Material</font></td>
                    <td width="268" height="34" align="center" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Size(mm)</font></td>
                    <td width="306" height="34" align="center" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Length (Km)</font></td>
                  </tr>
                  <tr>
                    <td align="center" height="20">&nbsp;</td>
                    <td height="20" align="center">&nbsp;</td>
                    <td height="20" align="center">&nbsp;</td>
                  </tr>
				 <?php
				 for($i=1; $i<=12; $i++)
				 {
				 ?>
                 <tr>
                    <td width="216" align="center">
						<select size="1" name="ris_material<?php echo $i;?>" id="ris_material<?php echo $i;?>" class="txt" >
						<option selected value="0">Select Material</option>
						<?php 
						//$material=array(1=>'AC', 'PVC', 'HDPE', 'G.I.', 'D.I.', 'C.I.');
						foreach($material as $key=>$val)
						{
		   					echo "<option value=$val>$val</option>";
						}
						?>
						</select></td>
                    <td align="center"><select size="1" name="ris_size<?php echo $i;?>" id="ris_size<?php echo $i;?>" class="txt">
						<option selected value="0">Select Size</option>
						<?php 
						foreach($size as $key=>$val)
						{
		   					echo "<option value=$val>$val</option>";
						}
						?>
						</select></td>
					<td align="center"><input type="text" name="ris_length<?php echo $i;?>" id="ris_length<?php echo $i;?>" size="18" class="txt5" onBlur="float(this)"></td>
				  </tr>
				<?php } ?>
                  <tr>
                    <td width="216">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td height="29" colspan="3" bgcolor="#C5D8EB">&nbsp; <b> <font style="font-size: 8.5pt" face="Verdana" color="#006699"> Pipelines (Distribution Main)</font></b></td>
            </tr>
            <tr>
              <td colspan="3"><table border="0" width="790" cellspacing="0" cellpadding="0">
                  <tr>
                    <td align="center" width="216" height="34" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Material</font></td>
                    <td width="268" height="34" align="center" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Size(mm)</font></td>
                    <td width="306" height="34" align="center" bgcolor="#CCCCCC"><font style="font-size: 8.5pt" face="Verdana" color="#000000"> Length (Km)</font></td>
                  </tr>
                  <tr>
                    <td align="center" height="22">&nbsp;</td>
                    <td height="22" align="center">&nbsp;</td>
                    <td height="22" align="center">&nbsp;</td>
                  </tr>
				  <?php
				 for($i=1; $i<=12; $i++)
				 {
				?>
                  <tr>
                    <td width="216" height="23" align="center">
						<select size="1" name="dis_material<?php echo $i;?>" id="dis_material<?php echo $i;?>" class="txt" >
							<option selected value="0">Select Material</option>
							<?php 
							foreach($material as $key=>$val)
							{
		   						echo "<option value=$val>$val</option>";
							}
							?>
				    </select>					</td>
                    <td align="center"><select size="1" name="dis_size<?php echo $i;?>" id="dis_size<?php echo $i;?>" class="txt">
						<option selected value="0">Select Size</option>
						<?php 
						foreach($size as $key=>$val)
						{
		   					echo "<option value=$val>$val</option>";
						}
						?>
						</select></td>
                    <td align="center"><input type="text" name="dis_length<?php echo $i;?>" id="dis_length<?php echo $i;?>" size="18" class="txt5" onBlur="float(this)"></td>
                  </tr>
				  <?php } ?>
                  <tr>
                    <td width="216">&nbsp;</td>
                    <td>&nbsp;</td>
                    <td>&nbsp;</td>
                  </tr>
              </table></td>
            </tr>
            <tr>
              <td colspan="3">&nbsp;</td>
            </tr>
            <tr>
              <td bgcolor="#C5D8EB" height="28" colspan="4"><span style="font-weight: 700"><font face="Arial" style="font-size: 8.5pt" color="#006699">&nbsp;&nbsp;Public Stand Post (PSP) </font></span> </td>
            </tr>
            <tr>
              <td colspan="2"><table border="0" width="791" id="table12" cellpadding="0">
                  <tr>
                    <td align="center" bgcolor="#CCCCCC" colspan="2">&nbsp;</td>
                  </tr>
                  <tr>
                    <td width="47%" align="center"><font style="font-size: 8.5pt" face="Verdana" color="#990000">Total No. of PSPs</font></td>
                    <td width="53%" align="center"><input type="text" name="psp_total" id="psp_total" size="20" class="txt5" onBlur="showpsp_q1();numeric(this)"></td>
                  </tr>
                  
                  <tr>
                    <td colspan="2"><div id="show_psp_q1"></div></td>
                  </tr>
              </table></td>
            </tr>
            
          </table></td>
		</tr>
		<tr>
			<td>
			<p align="center">
			<input type="submit" value="Click for Continue" name="submit" style="font-family: Verdana;">&nbsp;</td>
		</tr>
		<tr>
			<td>&nbsp;</td>
		</tr>
	</table>
</form>		
</div>

</body>
</html>